package com.duoqin.syncassistant.data.remote;

import com.duoqin.common.data.DefaultResponse;
import com.duoqin.syncassistant.data.BackupFileRestoreResponse;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface ApiInterface {
    @POST("uc/vcard")
    Call<DefaultResponse> vcardBackup(@Header("Authorization") String token,
                                      @Query("hash") String hash,
                                      @Query("count") int count,
                                      @Body RequestBody vCardBytes);

    @GET("uc/vcard")
    Call<BackupFileRestoreResponse> vcardRestore(@Header("Authorization") String token,
                                                 @Query("size") int size,
                                                 @Query("page") int page);

    @DELETE("uc/vcard")
    Call<DefaultResponse> deleteVCard(@Header("Authorization") String token,
                                      @Query("id") String id);

    @GET
    Call<ResponseBody> downloadVCard(@Url String vCardUrl);

    @POST("uc/sms")
    Call<DefaultResponse> smsBackup(@Header("Authorization") String token,
                                      @Query("hash") String hash,
                                      @Query("count") int count,
                                      @Body RequestBody vCardBytes);

    @GET("uc/sms")
    Call<BackupFileRestoreResponse> smsRestore(@Header("Authorization") String token,
                                               @Query("size") int size,
                                               @Query("page") int page);

    @DELETE("uc/sms")
    Call<DefaultResponse> deleteSMS(@Header("Authorization") String token,
                                      @Query("id") String id);

    @GET
    Call<ResponseBody> downloadSMS(@Url String vCardUrl);
}